function muestraLogin(){
	ponerCapaDeshabilitadora(true);
	Effect.Fade('page_wrapper',{from:1.0, to:0.4});
	if(!$("zonalogin"))
		new Ajax.Updater('login', 'procesa/ventana_login.jsp',
		{onSuccess: function(){
					Effect.Appear('zonalogin');
					Effect.Appear('capalogin');
				}
		});
	else{
		Effect.Appear('zonalogin');
		Effect.Appear('capalogin');
	}
}

function ocultarLogin(){
	Effect.Fade('zonalogin');
	Effect.Appear('page_wrapper');
	setTimeout("Element.hide('error_login')", 900);
	ponerCapaDeshabilitadora(false);
}

function cerrarSesion(idsesion){
	new Ajax.Request("procesa/proc_cerrar_sesion.jsp", 
	//?id="+idsesion
		{asynchronous:true,
		onSuccess: function(){	    
				 	setTimeout("direccionar('index.jsp')", 500);
				 },
		onFailure: function(){
					alert("Error al invalidar sesion");
					}
	});
}

function cerrarSesionAdmin(idsesion){
	new Ajax.Request("procesa/proc_cerrar_sesion.jsp", 
		{asynchronous:true,
		onSuccess: function(){
				 	direccionar("../index.jsp");
				 },
		onFailure: function(){
					alert("Error al invalidar sesion");
					}
	});
}
